import React, { useState, useEffect } from 'react';
import Layout from '../layout/html.js';

export default function Home(props) {

    return <Layout>
        <div className={`wrapper ${props.email ? 'ysearch' : 'nsearch'}`}>
            <div className='main'>
                <h2>查询DCO签署状态</h2>
                <div className='form'>
                    <input className='ant-input' value={props.email}></input>
                    <button className='ant-btn'>提交</button>
                </div>
                {
                    props.email ? <div className='list'>

                        {
                            props.comments?.length ? props.comments.map((v, i) => (
                                <div className='item' key={i}>
                                    <div className='body'>{ v.body }</div>
                                    <span>{String(v.createdAt)}</span>
                                </div>
                            )) : <div className='empty'>暂无数据</div>
                        }
                    </div> : null
                }
            </div>
        </div>
    </Layout>
}
